/*
 * MapPredator.hpp
 *
 *  Created on: 19 nov. 2008
 *      Author: Administrateur
 */

#ifndef MAPPREDATOR_HPP_
#define MAPPREDATOR_HPP_
//#include"TypeResource.h"
#include<map>
#include<vector>
using namespace std;


typedef vector<string>    anim;
typedef map<string, anim> map_animal;


class MapPredator {
public:
	// Constructor
	MapPredator() { }

	/**
	 * Add the prey for the predator given in argument.
	 * (Also add the predator for the prey given in argument)
	 *
	 * @param pred	type of predator
	 * @param prey	type of prey
	 */
	void addPredator(string const& pred, string const& prey);

	/**
	 * Check if the predator is really a predator of the prey given in argument.
	 *
	 * @param pred	type of predator
	 * @param prey	type of prey
	 *
	 * @return true if pred is a predator of the prey. False otherwise
	 */
	bool isPredator(string const& pred, string const& prey) const;

	/**
	 * Check if the prey is really a prey of the predator given in argument.
	 *
	 * @param pred	type of predator
	 * @param prey	type of prey
	 *
	 * @return true if prey is a prey of the predator. False otherwise
	 */
	bool isPrey(string const& pred, string const& prey) const ;

private:
	/******** Fill the map Prey->Predator ********/
	void addPrey(string const& prey, string const& pred) ;

private:
	map_animal 	predators;  // Map predator --> vector of prey
	map_animal 	preys;      // Map prey     --> vector of predator

};

#endif /* MAPPREDATOR_HPP_ */
